#ATM

class ATM:
    def __init__(self):
        self.account_balance = 10000

    def show_menu(self):
        print("ATM菜单：")
        print("1. 查询余额")
        print("2. 存款")
        print("3. 取款")
        print("4. 转账")
        print("5. 付款")
        print("6. 退出")

    def check_balance(self):
        print("您的账户余额为:", self.account_balance)

    def deposit(self, amount):
        self.account_balance += amount
        print("存款成功，当前余额为:", self.account_balance)

    def withdraw(self, amount):
        if amount <= self.account_balance:
            self.account_balance -= amount
            print("取款成功，当前余额为:", self.account_balance)
        else:
            print("余额不足，取款失败！")

    def transfer(self, amount):
        if amount <= self.account_balance:
            self.account_balance -= amount
            print("转账成功，当前余额为:", self.account_balance)
        else:
            print("余额不足，转账失败！")

    def pay(self, amount):
        if amount <= self.account_balance:
            self.account_balance -= amount
            print("付款成功，当前余额为:", self.account_balance)
        else:
            print("余额不足，付款失败！")


if __name__ == '__main__':
    atm = ATM()

    while True:
        atm.show_menu()
        choice = input("请选择操作：")

        if choice == '1':
            atm.check_balance()
        elif choice == '2':
            amount = float(input("请输入存款金额："))
            atm.deposit(amount)
        elif choice == '3':
            amount = float(input("请输入取款金额："))
            atm.withdraw(amount)
        elif choice == '4':
            amount = float(input("请输入转账金额："))
            atm.transfer(amount)
        elif choice == '5':
            amount = float(input("请输入付款金额："))
            atm.pay(amount)
        elif choice == '6':
            print("谢谢使用，再见！")
            break
        else:
            print("请输入有效的操作！")
